#include "Deleter.h"

#include <openssl/evp.h>
#include <openssl/x509.h>

void BnDeleter(BIGNUM* p)
{
    if (p) {
        BN_free(p);
    }
}

void ECPointDeleter(EC_POINT* p)
{
    if (p) {
        EC_POINT_free(p);
    }
}

void UCharOpenSSlDeleter(unsigned char* p)
{
    if (p) {
        OPENSSL_free(p);
    }
}

void EVP_PKEY_Deleter(EVP_PKEY* p)
{
    if (p) {
        EVP_PKEY_free(p);
    }
}

void BN_CTX_Deleter(BN_CTX* ctx)
{
    if (ctx) {
        BN_CTX_free(ctx);
    }
}

void X509_Deleter(X509* cert)
{
    if (cert) {
        X509_free(cert);
    }
}
